﻿using System;
using System.IO;
using ThePresenter.Net.NetCom;

namespace ThePresenter.Net.PresenterCom.Actions
{
	[Serializable]
	public abstract class PresenterAction
	{
		public byte[] Serialize()
		{
			byte[] bytes = null;

			using (var ms = new MemoryStream())
			{
				NetCom.NetComTools.BinaryFormatter.Serialize(ms, this);
				bytes = ms.ToArray();
			}

			return bytes;
		}
	}
}
